package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class BOS_FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("bos.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        String str = "亲爱的，你过得怎么样";
        byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
        System.out.println(bytes.length);
        bos.write(bytes);
        System.out.println("写出完毕");
        bos.flush();
        bos.close();
    }
}
